package com.leoman.plz_p.adapter;

import android.content.Context;

import com.leoman.plz_p.R;
import com.leoman.plz_p.module.bean.MissionDetailBean;

import cn.com.corelib.utils.adapter.BaseAdapterHelper;
import cn.com.corelib.utils.adapter.normal.QuickAdapter;

/**
 * Created by guoh on 2018/7/23.
 */
public class MissionPointAdapter extends QuickAdapter<MissionDetailBean> {
    public MissionPointAdapter(Context context) {
        super(context, R.layout.item_mission_detial_list);
    }

    @Override
    protected void convert(BaseAdapterHelper helper, MissionDetailBean item, int position) {
        switch (item.getStatus()){
            case 1:
                helper.setBackgroundRes(R.id.iv_point_progress,R.mipmap.icon_zero_to_four);
                break;
            case 2:
                helper.setBackgroundRes(R.id.iv_point_progress,R.mipmap.icon_one_to_one);
                break;
        }

        switch (item.getType()){
            case 1:
                helper.setText(R.id.tv_point_name,item.getName());
                helper.setText(R.id.tv_point_status,item.getStatus()==1?"未完成":"已完成");
                helper.setBackgroundRes(R.id.iv_status,item.getStatus()==1?R.mipmap.icon_video_off:R.mipmap.icon_video_on);
                break;
            case 2:
                helper.setText(R.id.tv_point_name,item.getName());
                helper.setText(R.id.tv_point_status,item.getStatus()==1?"未完成":"已完成");
                helper.setBackgroundRes(R.id.iv_status,item.getStatus()==1?R.mipmap.icon_realdo_off:R.mipmap.icon_realdo_on);
                break;
        }
    }

}
